import java.time.LocalDate;
import java.util.Scanner;

public class DayOfYearCalculator {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年月日，格式为：年-月-日");
        System.out.print("请输入：");
        String yearAndMonthDay = scanner.next();
        // 使用 LocalDate 类解析输入的日期字符串
        LocalDate date = LocalDate.parse(yearAndMonthDay);
        // 获取用户输入的年份、月份和日期
        int year = date.getYear();
        int month = date.getMonthValue();
        int day = date.getDayOfMonth();

        // 计算并输出这一天是这一年的第几天
        int dayOfYear = calculateDayOfYear(year, month, day);
        System.out.println(year + "年" + month + "月" + day + "日是这一年的第" + dayOfYear + "天。");
    }
    private static int calculateDayOfYear(int year, int month, int day) {
        // 创建 LocalDate 对象
        LocalDate date = LocalDate.of(year, month, day);
        // 获取这一年的第几天
        return date.getDayOfYear();
    }
}